home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / thelp4.zip / THELP4.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1988-03-04  |  37.7 KB  |  841 lines

  1. {$R-}    {Range checking off}
  2. {$B+}    {Boolean complete evaluation on}
  3. {$S+}    {Stack checking on}
  4. {$I+}    {I/O checking on}
  5. {$N-}    {No numeric coprocessor}
  6. {$M 1024,0,3072}
  7.  
  8. { Program THELP was originally written by a Mr. Glenn Wood of the Greenville PC Club of
  9. Greenville, Texas.  This updated version was reprogrammed by John Sloan, AlphaOmega
  10. Computer Services, Devon, Alberta (CIS 71310,2267).  It is entirely memory
  11. resident and takes up about 46,944 K of memory space.  It has been tested on
  12. PCjr, PC CGA, EGA, PS2 VGA, MCGA.  To keep the memory size down, many of the
  13. original Procedure and Function help screens have been deleted.  These, however,
  14. are still available from the Turbo 4.0 editor using either <F1> or <ALT-F1>.
  15. Thelp 4.0 now installs correctly on the PCjr and searches for any available
  16. user interrupt between 60H and 67H.  If it finds an available slot it will
  17. install itself, otherwise it will abort with an error message.  Thelp 4.0
  18. will also detect whether it has already been installed or not.  The window
  19. routines have been borrowed from Eric Snyder's excellent Minigen vs 1.3
  20. screen generator.  This program uses Snyder's MGProg.TPU unit to compile.
  21. }
  22.  
  23.  
  24. PROGRAM THELP;
  25.  
  26. { $C-}
  27.  
  28. {VARIABLE SECTION FOR 'THELP'}
  29.  
  30. Uses
  31.   Crt,
  32.   Dos,
  33.   MGProg;
  34.  
  35. const
  36.   EntryChar       = 35;                { ALT 'H' }
  37.   Escape          = 0;
  38.   FirstRow        = 3;
  39.   FirstCol        = 11;
  40.   WindowWidth     = 60;
  41.   WindowLength    = 18;
  42.   Dr              = 3;
  43.   Mr              = 15;
  44.   Cr              = $0D;
  45.   KybdInt         = $16;
  46.   maxpage         = 5;  {maximum # of pages for each menu item}
  47.   Maxline         = 68;
  48.  
  49. Type
  50.   text80 = string[80];
  51.   Str80  = string[80];
  52.   FldTyp = Record
  53.            Typ             : Char;
  54.            Col,Row,Atr,Len : Byte;
  55.            Txt             : Str80;
  56.            End;
  57.   ScreenArray = Array[1..Maxline] of Fldtyp;
  58.  
  59. var
  60.   UserInt    : byte;
  61.   exitcode   : word;
  62.   reg        : Registers;
  63.   i,j,x,y    : integer;
  64.   Selection  : integer;
  65.   Vector1,
  66.   Vector2    : Pointer;
  67.   pagetop    : array[1..maxpage] of byte;
  68.   page       : byte;
  69.   Esc        : boolean;
  70.  
  71. { MISC. PROCEDURES AND FUNTIONS FOR THELP }
  72.  
  73. procedure Brite(line:text80);
  74. begin
  75.   textcolor(15);
  76.   write(line);
  77.   textcolor(7);
  78. end;
  79.  
  80. procedure PrintHeading;
  81. begin
  82.   brite('T');       write('URBO Pascal ');
  83.   brite('Help   ');  write('Ver 4.0');
  84. end;
  85.  
  86. { MENU PRINT PROCEDURES FOR THELP }
  87.  
  88. procedure PrintMenu(number:integer);
  89. begin
  90.   case number of
  91.     0  : begin
  92.            gotoxy(mr+4,2);   PrintHeading;
  93.            gotoxy(mr+7,5);  brite('MAIN MENU');
  94.            gotoxy(mr,6);   write('<1> Syntax Structure');
  95.            gotoxy(mr,7);   write('<2> Compiler Directives');
  96.            gotoxy(mr,8);  write('<3> Fatal Runtime Errors');
  97.            gotoxy(mr,9);  write('<4> I/O Errors and Dos Errors');
  98.            gotoxy(mr,10);  write('<5> Reserved Words');
  99.            gotoxy(mr,11); write('<6> Keyboard Scan codes');
  100.          end;
  101.     1  : begin
  102.            gotoxy(mr+4,2);   PrintHeading;
  103.            gotoxy(mr+6,5);   brite('SYNTAX STRUCTURE MENU');
  104.            gotoxy(mr,6);   write('<1> Types and Type Casting');
  105.            gotoxy(mr,7);   write('<2> Constants and Typed Constants');
  106.            gotoxy(mr,8);   write('<3> Variables');
  107.            gotoxy(mr,9);   write('<4> Operators');
  108.            gotoxy(mr,10);  write('<5> Program Structure');
  109.            gotoxy(mr,11);  write('<6> Procedure and Function Structure');
  110.            gotoxy(mr,12);  write('<7> Unit Structure');
  111.            gotoxy(mr,13);  write('<8> Statements');
  112.          end;
  113.   end;{case}
  114.  
  115.   repeat
  116.     gotoxy(14,18);  Brite('Enter Selection or <ESC> to Exit ');
  117.     reg.ax := $00;
  118.     Intr(userint,reg);
  119.     selection:=reg.ah -1
  120.   until ((selection in [0..9]) and (number = 0))
  121.      or ((selection in [0..8]) and (number = 1));
  122.   clrscr;
  123. end;
  124.  
  125. Procedure WriteScreen(Numfields:byte; Var FieldsArray);
  126.  
  127. Type
  128.     ScreenArray = Array[1..Maxline] of Fldtyp;{allows variable length arrays
  129.                                                to be passed in as an untyped
  130.                                                variable and then typecast to
  131.                                                this array type}
  132.  
  133. Var i,j,k:byte;
  134.     key   :char;
  135.  
  136. procedure Pause(var key:char);
  137.  
  138. Var ch:char;
  139.  
  140. begin
  141.   Case key of
  142.     '1':begin
  143.         gotoxy(22,18); brite('<PgDn>');write(' for next PAGE');
  144.         Repeat until Keypressed;
  145.         Repeat
  146.           ch:=Readkey;
  147.           if ord(ch) = 00 then
  148.           ch:=readkey;
  149.           if (ord(ch)= 81) or (ord(ch)=51) then key:='D';
  150.         Until ord(ch) in [51,81];
  151.         end;
  152.     'E':begin
  153.          gotoxy(12,18); brite('<PgUp> ');write('for previous page or ');brite('<Esc> for MENU');
  154.          Repeat until Keypressed;
  155.         Repeat
  156.          ch:=Readkey;
  157.          if ord(ch) = 00 then
  158.          ch:=readkey;
  159.          if (ord(ch)= 73) or (ord(ch)=57) then key:='U';
  160.          if (ord(ch)= 01) then key:='E';
  161.         Until ord(ch) in [57,73,$1B];
  162.         end;
  163.  'U','D':begin
  164.         gotoxy(12,18); brite('<PgUp> ');write('for previous page or ');brite('<PgDn>');
  165.           write(' for next PAGE');
  166.         Repeat until Keypressed;
  167.         Repeat
  168.           ch:=Readkey;
  169.           if ord(ch) = 00 then
  170.           ch:=readkey;
  171.           if (ord(ch)= 73) or (ord(ch)=57) then key:='U';
  172.           if (ord(ch)= 81) or (ord(ch)=51) then key:='D';
  173.          Until ord(ch) in [51,57,73,81];
  174.         end;
  175.   end;{case}
  176.  
  177. clrscr;
  178.  
  179. end; {Pause}
  180.  
  181. Begin  {WriteScreen}
  182. pagetop[1]:=1;
  183. I:=1;
  184. page:=1;
  185. Esc:=False;
  186. key:='1';
  187.  
  188. Repeat
  189.    With ScreenArray(FieldsArray)[I] do WinRite(Txt,Col,Row,Atr);
  190.    I:=I+1;
  191.    If (ScreenArray(Fieldsarray)[I].Row =1) or (I = Numfields +1) then
  192.       begin
  193.         If I = Numfields + 1 then key :='E';
  194.         Pause(key);
  195.         case key of
  196.         'U':If page <> 1 then
  197.             begin
  198.               I:=pagetop[page-1];
  199.               page:=page-1;
  200.             If page = 1 then
  201.               key:='1';
  202.             end;
  203.             {else
  204.             begin
  205.               I:=1;
  206.               key:='1';
  207.             end;}
  208.         'D':begin
  209.               page:=page+1;
  210.               pagetop[page]:=I
  211.             end;
  212.         'E':Esc:=True;
  213.        end;{Case}
  214.      end; {if}
  215.  
  216. Until Esc;
  217.  
  218. end; {WriteScreen}
  219.  
  220. procedure Wait;
  221. begin
  222.   gotoxy(17,18); brite('Press <ESC> To Return to MENU');
  223.   repeat
  224.     reg.ax := 0;
  225.     Intr(userint,reg);
  226.   until reg.ah = $01;
  227.   clrscr;
  228. end;
  229.  
  230. procedure PrintType;
  231.  
  232. Type
  233.   Str80  = string[80];
  234.   FldTyp = Record
  235.            Typ             : Char;
  236.            Col,Row,Atr,Len : Byte;
  237.            Txt             : Str80;
  238.            End;
  239.  
  240. Const
  241.   NumFields   = 28;
  242.   FieldsArray :  Array[1..Numfields] of Fldtyp =
  243.   (
  244.   (Typ:'T';Col:23;Row:1;Atr:31;Len:60;Txt:'TYPES (pg. 207)'),
  245.   (Typ:'T';Col:2;Row:2;Atr:31;Len:60;Txt:'   Simple Type: (pg. 208)'),
  246.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:'    days      = 1..30; {Ordinal}'),
  247.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'    day       = (monday,tuesday,wednesday,thursday,'),
  248.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:'                friday,saturday,sunday); {Enumerated}'),
  249.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'    letter    = ''a''..''z''); {subrange}'),
  250.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:'    Hex       = byte; {0..255}'),
  251.   (Typ:'T';Col:2;Row:8;Atr:23;Len:60;Txt:'    Smallnum  = shortint; {-128..127}'),
  252.   (Typ:'T';Col:2;Row:9;Atr:23;Len:60;Txt:'    A/D_range = integer; {-32768..32767}'),
  253.   (Typ:'T';Col:2;Row:10;Atr:23;Len:60;Txt:'    Address   = word; {0..65535}'),
  254.   (Typ:'T';Col:2;Row:11;Atr:31;Len:60;Txt:'   Boolean Type: (pg. 210)'),
  255.   (Typ:'T';Col:2;Row:12;Atr:23;Len:60;Txt:'    Switch    = boolean {False < True}'),
  256.   (Typ:'T';Col:2;Row:13;Atr:31;Len:60;Txt:'   Char type: (pg. 210)'),
  257.   (Typ:'T';Col:2;Row:14;Atr:23;Len:60;Txt:'    C         = char {''A''..''Z'',''a''..''z'',''0''..''9''}'),
  258.   (Typ:'T';Col:23;Row:1;Atr:31;Len:60;Txt:'TYPES (con''t)'),
  259.   (Typ:'T';Col:2;Row:2;Atr:31;Len:60;Txt:'   Real type: (pg. 212)'),
  260.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:'    Distance   = real; {2.9e-39..1.7e38 11..12 digits}'),
  261.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'    wavelength = single; {8087 only}'),
  262.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:'    bignumber  = double; {8087 only}'),
  263.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'    supernumber= extended; {8087 only}'),
  264.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:'    Big_num    =  longint; {-2147483648..217483647}'),
  265.   (Typ:'T';Col:2;Row:8;Atr:31;Len:60;Txt:'   String Type: (pg. 213)'),
  266.   (Typ:'T';Col:2;Row:9;Atr:23;Len:60;Txt:'    text80     = STRING[80]; {1..255}'),
  267.   (Typ:'T';Col:2;Row:10;Atr:23;Len:60;Txt:'    text_255   = STRING; {default}'),
  268.   (Typ:'T';Col:2;Row:11;Atr:31;Len:60;Txt:'   Typecasting: (pg. 229)'),
  269.   (Typ:'T';Col:2;Row:12;Atr:23;Len:60;Txt:'    Type P     = word;'),
  270.   (Typ:'T';Col:2;Row:13;Atr:23;Len:60;Txt:'    Var  Q:integer;'),
  271.   (Typ:'T';Col:2;Row:14;Atr:23;Len:60;Txt:'      Begin P :=word(Q) End. {variable typecast} ')
  272.   );
  273.  
  274. Begin
  275.   WriteScreen(Numfields,Fieldsarray);
  276. end;
  277.  
  278. Procedure PrintConst;
  279.  
  280. Type
  281.   Str80  = string[80];
  282.   FldTyp = Record
  283.            Typ             : Char;
  284.            Col,Row,Atr,Len : Byte;
  285.            Txt             : Str80;
  286.            End;
  287.  
  288. Const
  289.   NumFields   = 30;
  290.   FieldsArray : Array[1..Numfields] of Fldtyp =
  291.   (
  292.   (Typ:'T';Col:18;Row:1;Atr:31;Len:60;Txt:'Constants and Typed Constants '),
  293.   (Typ:'T';Col:2;Row:2;Atr:31;Len:60;Txt:'        { integer, real, boolean, char, string[xx] }'),
  294.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:'    Const {pg. 202}'),
  295.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'      minus2     = -2;'),
  296.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:'      pagesize   = 60;'),
  297.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'      pi         = 3.1415926535;'),
  298.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:'      histring   = ''hello'';'),
  299.   (Typ:'T';Col:2;Row:8;Atr:23;Len:60;Txt:'      valid      = TRUE;'),
  300.   (Typ:'T';Col:20;Row:1;Atr:31;Len:60;Txt:'Typed Constants (pg. 231)'),
  301.   (Typ:'T';Col:2;Row:2;Atr:23;Len:60;Txt:'    Const'),
  302.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:'      Maximum   : integer = 9999;'),
  303.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'      Breakchar : char = #3;'),
  304.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:'      Heading   : string[7] = ''Section'' '),
  305.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'      Newline   : string[2] = #13#10;'),
  306.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:'      Digits    : array[0..3] of char = (''0123'')'),
  307.   (Typ:'T';Col:2;Row:8;Atr:23;Len:60;Txt:'    Type'),
  308.   (Typ:'T';Col:2;Row:9;Atr:23;Len:60;Txt:'      Cube = array[0..1,0..1,0..1] of integer;'),
  309.   (Typ:'T';Col:2;Row:10;Atr:23;Len:60;Txt:'      Const'),
  310.   (Typ:'T';Col:2;Row:11;Atr:23;Len:60;Txt:'      Maze: Cube = (((0,1),(2,3)),((4,5),(6,7)));'),
  311.   (Typ:'T';Col:20;Row:1;Atr:31;Len:60;Txt:'Typed Constants (con''t.)'),
  312.   (Typ:'T';Col:2;Row:2;Atr:23;Len:60;Txt:'    Type'),
  313.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:'      Point = record'),
  314.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'      x,y: real;'),
  315.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:'      end;'),
  316.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'    Const'),
  317.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:'      Origon : Point = (x: 0.0; y: 0.0);'),
  318.   (Typ:'T';Col:2;Row:8;Atr:23;Len:60;Txt:'      Type'),
  319.   (Typ:'T';Col:2;Row:9;Atr:23;Len:60;Txt:'        Letters = set of ''A''..''Z'';'),
  320.   (Typ:'T';Col:2;Row:10;Atr:23;Len:60;Txt:'        Const'),
  321.   (Typ:'T';Col:2;Row:11;Atr:23;Len:60;Txt:'        Vowels : = [''A'',''E'',''I'',''O'',''U'',''Y''];')
  322.   );
  323.  
  324. Begin
  325.   WriteScreen(Numfields,Fieldsarray);
  326. end;
  327.  
  328. Procedure PrintVar;
  329. begin
  330.   gotoxy(dr+18,2);brite('Variables: (pg. 223)');
  331.   gotoxy(dr,3);   write('         {integer, real, boolean, char, string[xx] }');
  332.   gotoxy(dr,4);   write('  VAR');
  333.   gotoxy(dr,5);   write('    count,index    : Integer;');
  334.   gotoxy(dr,6);   write('    result,value   : Real;');
  335.   gotoxy(dr,7);   write('    eom,character  : Char;');
  336.   gotoxy(dr,8);   write('    line           : String[80];');
  337.   gotoxy(dr,9);   write('    error          : Boolean;');
  338.   gotoxy(dr,10);  write('    inventory      : File of invtype;');
  339.   gotoxy(dr,11);  write('    matrix         : Array [1..50,1..50] of Integer;');
  340.   gotoxy(dr,12);  write('    cmdlength      : Byte Absolute Prefixseg:$0080;');
  341.   gotoxy(dr,13);  write('    cmdline        : String[127] Absolute Prefixseg:$0080;');
  342.   gotoxy(dr,14);  write('    intrip         : Integer Absolute $0000:$0040;');
  343.   Wait;
  344. end;
  345.  
  346. Procedure operator1;
  347.  
  348. { MiniGen V1.3 }
  349.  
  350. Type
  351.  
  352.   Str80  = String[80];
  353.   FldTyp = Record
  354.            Typ             : Char;
  355.            Col,Row,Atr,Len : Byte;
  356.            Txt             : Str80;
  357.            End;
  358.  
  359. Const
  360.   NumFields   = 50;
  361.   FieldsArray : Array[1..Numfields] of Fldtyp =
  362.   (
  363.   (Typ:'T';Col:2;Row:1;Atr:31;Len:60;Txt:'                   Operators (pg. 241)'),
  364.   (Typ:'T';Col:2;Row:2;Atr:31;Len:60;Txt:' Operators      Operation      Operand Types   Result Type'),
  365.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:' +              addition       integer type    integer type'),
  366.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'                               real type       real type '),
  367.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:' -              subtraction    integer typ     integer type'),
  368.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'                               real type       real type'),
  369.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:' *              multiplication integer type    integer type'),
  370.   (Typ:'T';Col:2;Row:8;Atr:23;Len:60;Txt:'                               real type       real type'),
  371.   (Typ:'T';Col:2;Row:9;Atr:23;Len:60;Txt:' /              division       integer type    real type'),
  372.   (Typ:'T';Col:2;Row:10;Atr:23;Len:60;Txt:'                               real type       real type'),
  373.   (Typ:'T';Col:2;Row:11;Atr:23;Len:60;Txt:' div            int. division  integer type    integer type'),
  374.   (Typ:'T';Col:2;Row:12;Atr:23;Len:60;Txt:' mod            remainder      integer type    integer type'),
  375.   (Typ:'T';Col:2;Row:13;Atr:23;Len:60;Txt:' +              sign identity  integer type    integer type'),
  376.   (Typ:'T';Col:2;Row:14;Atr:23;Len:60;Txt:'                               real type       real type'),
  377.   (Typ:'T';Col:2;Row:15;Atr:23;Len:60;Txt:' -              sign negation  integer type    integer type'),
  378.   (Typ:'T';Col:2;Row:16;Atr:23;Len:60;Txt:'                               real type       real type'),
  379.   (Typ:'T';Col:2;Row:1;Atr:31;Len:60;Txt:'                   Logical Operators (pg. 242)'),
  380.   (Typ:'T';Col:3;Row:2;Atr:31;Len:60;Txt:' Operator     Operation     Operand Types   Result type'),
  381.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:'  not          Bit negation  integer type    integer type'),
  382.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'  and          Bit and       integer type    integer type'),
  383.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:'  or           Bit or        integer type    integer type'),
  384.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'  xor          Bit xor       integer type    integer type'),
  385.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:'  shl          Shift left    integer type    integer type'),
  386.   (Typ:'T';Col:2;Row:8;Atr:23;Len:60;Txt:'  shr          Shift right   integer type    integer type'),
  387.   (Typ:'T';Col:2;Row:9;Atr:23;Len:60;Txt:'  not          negation      boolean         boolean'),
  388.   (Typ:'T';Col:2;Row:10;Atr:23;Len:60;Txt:'  and          logical and   boolean         boolean'),
  389.   (Typ:'T';Col:2;Row:11;Atr:23;Len:60;Txt:'  or           logical or    boolean         boolean'),
  390.   (Typ:'T';Col:2;Row:12;Atr:23;Len:60;Txt:'  xor          logical xor   boolean         boolean'),
  391.   (Typ:'T';Col:2;Row:13;Atr:23;Len:60;Txt:'  +            Concatenation string,char     string type'),
  392.   (Typ:'T';Col:2;Row:14;Atr:23;Len:60;Txt:'                             or packed string types'),
  393.   (Typ:'T';Col:2;Row:15;Atr:23;Len:60;Txt:'  +            union         compatible set types'),
  394.   (Typ:'T';Col:2;Row:16;Atr:23;Len:60;Txt:'  -            difference    compatible set types'),
  395.   (Typ:'T';Col:2;Row:17;Atr:23;Len:60;Txt:'  *            intersection  compatible set types'),
  396.   (Typ:'T';Col:20;Row:1;Atr:31;Len:41;Txt:' Relational Operators (pg. 246)'),
  397.   (Typ:'T';Col:3;Row:2;Atr:31;Len:60;Txt:'  Operator     Operation      Operand Types     Result type'),
  398.   (Typ:'T';Col:2;Row:3;Atr:23;Len:60;Txt:'   =            equal          simple pointer    boolean '),
  399.   (Typ:'T';Col:2;Row:4;Atr:23;Len:60;Txt:'                               pointer,set,'),
  400.   (Typ:'T';Col:2;Row:5;Atr:23;Len:60;Txt:'                               string or packed string'),
  401.   (Typ:'T';Col:2;Row:6;Atr:23;Len:60;Txt:'   <>           not equal      same as above     boolean'),
  402.   (Typ:'T';Col:2;Row:7;Atr:23;Len:60;Txt:'   <            not equal      same as above     boolean'),
  403.   (Typ:'T';Col:2;Row:8;Atr:23;Len:60;Txt:'   >            greater than   same as above     boolean'),
  404.   (Typ:'T';Col:2;Row:9;Atr:23;Len:60;Txt:'   <=           less or equal  same as above     boolean'),
  405.   (Typ:'T';Col:2;Row:10;Atr:23;Len:60;Txt:'   >=           great or equal same as above     boolean'),
  406.   (Typ:'T';Col:2;Row:11;Atr:23;Len:60;Txt:'   <=           subset of      compatible sets   boolean'),
  407.   (Typ:'T';Col:2;Row:12;Atr:23;Len:60;Txt:'   >=           superset of    compatible sets   boolean'),
  408.   (Typ:'T';Col:2;Row:13;Atr:23;Len:60;Txt:'   in           member of      left operand:any  boolean'),
  409.   (Typ:'T';Col:2;Row:14;Atr:23;Len:60;Txt:'                               ordinal type t;'),
  410.   (Typ:'T';Col:2;Row:15;Atr:23;Len:60;Txt:'                               right operand'),
  411.   (Typ:'T';Col:2;Row:16;Atr:23;Len:60;Txt:'                               set whose base is'),
  412.   (Typ:'T';Col:2;Row:17;Atr:23;Len:60;Txt:'                               compatible with t.')
  413.   );
  414.  
  415. Begin
  416.   WriteScreen(Numfields,Fieldsarray);
  417. end;
  418.  
  419. procedure ProgramStructure;
  420. begin
  421.   gotoxy(dr+15,1);   brite('Program Structure: (pg 57)');
  422.   gotoxy(dr,2);   write('    Program ProgramName;');
  423.   gotoxy(dr,3);   write('    Label');
  424.   gotoxy(dr,4);   write('      {labels};');
  425.   gotoxy(dr,5);   write('    Const');
  426.   gotoxy(dr,6);   write('      {constant declarations};');
  427.   gotoxy(dr,7);   write('    Type');
  428.   gotoxy(dr,8);   write('      {data type declarations};');
  429.   gotoxy(dr,9);   write('    Var');
  430.   gotoxy(dr,10);  write('      {variable declarations};');
  431.   gotoxy(dr,11);  write('    {procedures}');
  432.   gotoxy(dr,12);  write('      Procedure ProcedureName(parameters);');
  433.   gotoxy(dr,13);  write('    {functions}');
  434.   gotoxy(dr,14);  write('      Function FunctionName(parameters):data type;');
  435.   gotoxy(dr,15);  write('    begin {main program body}');
  436.   gotoxy(dr,16);  write('      {statements};');
  437.   gotoxy(dr,17);  write('    end. {main program}');
  438.   Wait;
  439. end;
  440.  
  441. Procedure ProcFunc_Structure;
  442.  
  443. begin
  444.   gotoxy(2,1); brite('           Procedure and Function Structure (pg. 57)');
  445.   gotoxy(2,2); write('    ProcName(Var num1,num2 : Integer; ch : Char)');
  446.   gotoxy(2,3); write('    Interrupt; {stacks registers if used as ISR, pg. 369}');
  447.   gotoxy(2,4); write('    Label');
  448.   gotoxy(2,5); write('       {labels};');
  449.   gotoxy(2,6); write('    Const');
  450.   gotoxy(2,7); write('       {constant declarations};');
  451.   gotoxy(2,8); write('    Type');
  452.   gotoxy(2,9); write('       {data type definitions};');
  453.   gotoxy(2,10); write('    Var');
  454.   gotoxy(2,11); write('       {variable declarations};');
  455.   gotoxy(2,12); write('    {local procedure and function declarations};');
  456.   gotoxy(2,13); write('    Begin {main body of procedure}');
  457.   gotoxy(2,14); write('       {statements};');
  458.   gotoxy(2,15); write('    End;');
  459.   gotoxy(2,16); write('    Function FunctionName(parameters):data_type;');
  460.   gotoxy(2,17); write('       {structure same as above}');
  461. wait;
  462. end;
  463.  
  464. Procedure Unit_structure;
  465. begin
  466.   gotoxy(dr+15,1);   brite('Unit Structure: (pg 61)');
  467.   gotoxy(dr,2);   write('    Unit UnitName;');
  468.   gotoxy(dr,3);   write('    Interface');
  469.   gotoxy(dr,4);   write('    Uses {list all units that are used by this one}');
  470.   gotoxy(dr,5);   write('      {Declare all constants, data types, variables,}');
  471.   gotoxy(dr,6);   write('      { procedure and function headers (not body)   } ');
  472.   gotoxy(dr,7);   write('      { that will be accessible by any program.     }');
  473.   gotoxy(dr,8);   write('    Implementation');
  474.   gotoxy(dr,9);   write('      {Private declarations and                 }');
  475.   gotoxy(dr,10);  write('      {procedure and function headers and bodies}');
  476.   gotoxy(dr,11);  write('      {declared in Interface section            }');
  477.   gotoxy(dr,12);  write('    End. {not used if next initialization section used}');
  478.   gotoxy(dr,13);  write('    Begin');
  479.   gotoxy(dr,14);  write('      {Used to initialize any data structures etc.}');
  480.   gotoxy(dr,15);  write('      {used by this unit.  It is called before    }');
  481.   gotoxy(dr,16);  write('      {main body of program using this unit is run}');
  482.   gotoxy(dr,17);  write('    End. {of unit}');
  483.   Wait;
  484. end;
  485.  
  486. Procedure Statements;
  487.  
  488. { MiniGen V1.3 }
  489.  
  490. Type
  491.   Str80  = String[80];
  492.   FldTyp = Record
  493.            Typ             : Char;
  494.            Col,Row,Atr,Len : Byte;
  495.            Txt             : Str80;
  496.            End;
  497.  
  498. Const
  499.   NumFields   = 43;
  500.   FieldsArray : Array[1..Numfields] of Fldtyp =
  501.   (
  502.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'               Statement Syntax (pg. 253)'),
  503.   (Typ:'T';Col:6;Row:2;Atr:31;Len:57;Txt:'Assignment Statements:'),
  504.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'   X := Y + Z;'),
  505.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'   Done := (I > 1) and (I < 100);'),
  506.   (Typ:'T';Col:6;Row:5;Atr:31;Len:57;Txt:'Procedure Statements:'),
  507.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'   PrintHeading;'),
  508.   (Typ:'T';Col:6;Row:7;Atr:23;Len:57;Txt:'   Fine(Name, Address);'),
  509.   (Typ:'T';Col:6;Row:8;Atr:31;Len:57;Txt:'Goto Statement:'),
  510.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'   10 Goto 10; {forever loop}'),
  511.   (Typ:'T';Col:6;Row:10;Atr:31;Len:57;Txt:'Structure Statements:'),
  512.   (Typ:'T';Col:6;Row:11;Atr:31;Len:57;Txt:'   Compound:'),
  513.   (Typ:'T';Col:6;Row:12;Atr:23;Len:57;Txt:'      begin'),
  514.   (Typ:'T';Col:6;Row:13;Atr:23;Len:57;Txt:'         Z := X;'),
  515.   (Typ:'T';Col:6;Row:14;Atr:23;Len:57;Txt:'         X := Y;'),
  516.   (Typ:'T';Col:6;Row:15;Atr:23;Len:57;Txt:'      end;'),
  517.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'               Statement Syntax (con''t)'),
  518.   (Typ:'T';Col:6;Row:2;Atr:31;Len:57;Txt:'   Conditional:'),
  519.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'      If x < 1.5 then'),
  520.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'         Z := X + Y'),
  521.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'      else'),
  522.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'         Z := 1.5;'),
  523.   (Typ:'T';Col:6;Row:7;Atr:31;Len:57;Txt:'   Case:'),
  524.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:'      case Operator of'),
  525.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'        plus :  X := X+Y;'),
  526.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:'        Minus:  X := X-Y;'),
  527.   (Typ:'T';Col:6;Row:11;Atr:23;Len:57;Txt:'      else ...'),
  528.   (Typ:'T';Col:6;Row:12;Atr:31;Len:57;Txt:'Repeat Statements:'),
  529.   (Typ:'T';Col:6;Row:13;Atr:23;Len:57;Txt:'   Repeat'),
  530.   (Typ:'T';Col:6;Row:14;Atr:23;Len:57;Txt:'      Count := Count + 1;'),
  531.   (Typ:'T';Col:6;Row:15;Atr:23;Len:57;Txt:'   Until Count >= 40;'),
  532.   (Typ:'T';Col:6;Row:16;Atr:23;Len:57;Txt:'   While Count > 0 do '),
  533.   (Typ:'T';Col:6;Row:17;Atr:23;Len:57;Txt:'      Writeln(''Count is '',Count);'),
  534.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'               Statement Syntax (con''t)'),
  535.   (Typ:'T';Col:6;Row:2;Atr:23;Len:57;Txt:'   For Count = 0 to 40 do'),
  536.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'     begin'),
  537.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'       If Keypressed then ch:=Readkey;'),
  538.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'       If ch in [''A'',''a''] then InputOK:=True;'),
  539.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'     end; {for}'),
  540.   (Typ:'T';Col:6;Row:7;Atr:31;Len:57;Txt:'With Statement:'),
  541.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:'   Var reg : registers; {predeclared record type}'),
  542.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'       ...'),
  543.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:'   with reg do'),
  544.   (Typ:'T';Col:6;Row:11;Atr:23;Len:57;Txt:'     if ax = $8000 then Busy := True;')
  545. );
  546.  
  547. Begin
  548.   WriteScreen(Numfields,Fieldsarray);
  549. end;
  550.  
  551. procedure PrintDirectives;
  552. begin
  553.   gotoxy(dr,1);   Brite('        COMPILER DIRECTIVES     page   Default');
  554.   gotoxy(dr,2);   write('    B - Boolean Evaluation      (528)     $B- ');
  555.   gotoxy(dr,3);   write('    D - debug info. On/off      (529)     $D+ ');
  556.   gotoxy(dr,4);   write('    F - Force Far calls         (529)     $F- ');
  557.   gotoxy(dr,5);   write('    I - I/O checking On/off     (530)     $I+ ');
  558.   gotoxy(dr,6);   write('    L - memory linking On/off   (530)     $L+ ');
  559.   gotoxy(dr,7);   write('    N - 8087 float.point On/off (530)     $N- ');
  560.   gotoxy(dr,8);   write('    R - Range Checking On/off   (531)     $R- ');
  561.   gotoxy(dr,9);   write('    S - Stack Over. Chk. On/off (531)     $S+ ');
  562.   gotoxy(dr,10);  write('    T - TPM. file On/off        (532)     $T- ');
  563.   gotoxy(dr,11);  write('    V - String type check On/off(532)     $V+ ');
  564.   gotoxy(dr,12);  write('    $I filename - include file  (533)         ');
  565.   gotoxy(dr,13);  write('    $l filename - link file     (533)         ');
  566.   gotoxy(dr,14);  write('    $M stacksize,heapmin,heapmax(534)         ');
  567.   gotoxy(dr,15);  write('    $U filename                 (534)         ');
  568.   Wait;
  569. end;
  570.  
  571. procedure RuntimeErrors;
  572. begin
  573.   gotoxy(dr,1);   Brite('          FATAL RUN-TIME ERROR MESSAGES : (pg. 629)');
  574.   gotoxy(dr,3);   write('    200 - Division by zero');
  575.   gotoxy(dr,4);   write('    201 - Range check error');
  576.   gotoxy(dr,5);   write('    202 - Stack overflow error');
  577.   gotoxy(dr,6);   write('    203 - Heap overflow error');
  578.   gotoxy(dr,7);   write('    204 - Invalid pointer operation');
  579.   gotoxy(dr,8);   write('    205 - Floating point overflow');
  580.   gotoxy(dr,9);   write('    206 - Floating point underflow');
  581.   gotoxy(dr,10);  write('    207 - Invalid floating point operation');
  582. Wait;
  583. end;
  584.  
  585. procedure IOErrors;
  586.  
  587. Type
  588.   Str80  = String[80];
  589.   FldTyp = Record
  590.            Typ             : Char;
  591.            Col,Row,Atr,Len : Byte;
  592.            Txt             : Str80;
  593.            End;
  594.  
  595. Const
  596.   NumFields   = 26;
  597.   FieldsArray : Array[1..Numfields] of Fldtyp =
  598.   (
  599.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'              I/O ERROR MESSAGES : (pg. 626) '),
  600.   (Typ:'T';Col:6;Row:2;Atr:23;Len:57;Txt:'  02  -  File not found.'),
  601.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'  03  -  Path not fount.'),
  602.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'  04  -  Too many open files.'),
  603.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'  05  -  File access denied.'),
  604.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'  06  -  Invalid file handle.'),
  605.   (Typ:'T';Col:6;Row:7;Atr:23;Len:57;Txt:'  12  -  Invalid file access code.'),
  606.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:'  15  -  Invalid drive number.'),
  607.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'  16  -  Cannot remove current directory.'),
  608.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:'  100 -  Disk read error.'),
  609.   (Typ:'T';Col:6;Row:11;Atr:23;Len:57;Txt:'  101 -  Disk write error'),
  610.   (Typ:'T';Col:6;Row:12;Atr:23;Len:57;Txt:'  102 -  File not assigned'),
  611.   (Typ:'T';Col:6;Row:13;Atr:23;Len:57;Txt:'  103 -  File not open'),
  612.   (Typ:'T';Col:6;Row:14;Atr:23;Len:57;Txt:'  104 -  File not found for input'),
  613.   (Typ:'T';Col:6;Row:15;Atr:23;Len:57;Txt:'  105 -  File not open for output'),
  614.   (Typ:'T';Col:6;Row:16;Atr:23;Len:57;Txt:'  106 -  Invalid numeric format'),
  615.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'              DOS error codes (pg. 300)'),
  616.   (Typ:'T';Col:6;Row:2;Atr:23;Len:57;Txt:'{returned in integer variable DosError in DOS unit}'),
  617.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'  2 - File not found'),
  618.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'  3 - Path not found'),
  619.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'  5 - Acess denied'),
  620.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'  6 - Invalid Handle'),
  621.   (Typ:'T';Col:6;Row:7;Atr:23;Len:57;Txt:'  8 - Not enough memory'),
  622.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:' 10 - Invalid environment'),
  623.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:' 11 - Invalid format'),
  624.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:' 18 - No more files')
  625. );
  626.  
  627. Var i,j,k:byte;
  628.     key   :char;
  629.  
  630. Begin
  631.   WriteScreen(Numfields,Fieldsarray);
  632. end;
  633.  
  634. Procedure Reserved_words;
  635.  
  636. begin
  637.   gotoxy(6,1); brite('                 Reserved Word List (pg. 196)');
  638.   gotoxy(6,2); write('absolute         goto                record');
  639.   gotoxy(6,3); write('and              if                  repeat');
  640.   gotoxy(6,4); write('array            implementation      set');
  641.   gotoxy(6,5); write('begin            in                  shl');
  642.   gotoxy(6,6); write('case             inline              shr');
  643.   gotoxy(6,7); write('const            interface           string');
  644.   gotoxy(6,8); write('div              interrupt           then');
  645.   gotoxy(6,9); write('do               label               to');
  646.   gotoxy(6,10); write('downto           mod                 type');
  647.   gotoxy(6,11); write('else             nil                 unit');
  648.   gotoxy(6,12); write('end              not                 until');
  649.   gotoxy(6,13); write('external         of                  uses');
  650.   gotoxy(6,14); write('file             or                  var');
  651.   gotoxy(6,15); write('for              packed              while');
  652.   gotoxy(6,16); write('forward          procedure           with');
  653.   gotoxy(6,17); write('function         program             xor');
  654.  
  655. wait;
  656.  
  657. End; {Reserved_words}
  658.  
  659. Procedure Key_Scan_Codes;
  660.  
  661. { MiniGen V1.3 }
  662.  
  663. Type
  664.   Str80  = String[80];
  665.   FldTyp = Record
  666.            Typ             : Char;
  667.            Col,Row,Atr,Len : Byte;
  668.            Txt             : Str80;
  669.            End;
  670.  
  671. Const
  672.   NumFields   = 68;
  673.   FieldsArray : Array[1..Numfields] of Fldtyp =
  674.   (
  675.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'            Keyboard Scan Codes (pg. 572)'),
  676.   (Typ:'T';Col:6;Row:2;Atr:31;Len:57;Txt:'Key   Code(Hex)   Key  Code(Hex)   Key  Code(Hex)'),
  677.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'Esc       01      A        1E      F1       3B'),
  678.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'!1        02      S        1F      F2       3C'),
  679.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'@2        03      D        20      F3       3D'),
  680.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'#3        04      F        21      F4       3E'),
  681.   (Typ:'T';Col:6;Row:7;Atr:23;Len:57;Txt:'$4        05      G        22      F5       3F'),
  682.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:'%5        06      H        23      F6       40'),
  683.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'^6        07      J        24      F7       41'),
  684.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:'&7        08      K        25      F8       42'),
  685.   (Typ:'T';Col:6;Row:11;Atr:23;Len:57;Txt:'*8        09      L        26      F9       43'),
  686.   (Typ:'T';Col:6;Row:12;Atr:23;Len:57;Txt:'(9        0A      :;       27      F10      44'),
  687.   (Typ:'T';Col:6;Row:13;Atr:23;Len:57;Txt:')0        0B      "''       28      F11      D9'),
  688.   (Typ:'T';Col:6;Row:14;Atr:23;Len:57;Txt:'_-        0C      ~`       29      F12      DA'),
  689.   (Typ:'T';Col:6;Row:15;Atr:23;Len:57;Txt:'+=        0D     Leftshift 2A      Scrlllck 46'),
  690.   (Typ:'T';Col:6;Row:16;Atr:23;Len:57;Txt:'Backspace 0E     Spacebar  39      Lt/RtArr 0F'),
  691.   (Typ:'T';Col:6;Row:17;Atr:23;Len:57;Txt:'CTRL      1D     Caps Lock 3A      Q        10'),
  692.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'            Keyboard Scan Codes (con''t)'),
  693.   (Typ:'T';Col:6;Row:2;Atr:31;Len:57;Txt:'Key   Code(Hex)   Key  Code(Hex)   Key   Code(hex)'),
  694.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'W         11      C        2E      4LftArr  4B'),
  695.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'E         12      V        2F      5        4C'),
  696.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'R         13      B        30      6RtArr   4D'),
  697.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'T         14      N        31      +        4E'),
  698.   (Typ:'T';Col:6;Row:7;Atr:23;Len:57;Txt:'Y         15      M        32      1End     4F'),
  699.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:'U         16      <,       33      2DwnArr  50'),
  700.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'I         17      >.       34      3PgDn    51'),
  701.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:'O         18      ?/       35      0Ins     52'),
  702.   (Typ:'T';Col:6;Row:11;Atr:23;Len:57;Txt:'P         19      Rtshift  36      Del      53'),
  703.   (Typ:'T';Col:6;Row:12;Atr:23;Len:57;Txt:'{[        1A      Prtscr*  37      NumLock  45'),
  704.   (Typ:'T';Col:6;Row:13;Atr:23;Len:57;Txt:'}]        1B      Alt      38'),
  705.   (Typ:'T';Col:6;Row:14;Atr:23;Len:57;Txt:'Return    1C      7Home    47'),
  706.   (Typ:'T';Col:6;Row:15;Atr:23;Len:57;Txt:'|\        2B      8UpArrw  48'),
  707.   (Typ:'T';Col:6;Row:16;Atr:23;Len:57;Txt:'Z         2C      9PgUp    49'),
  708.   (Typ:'T';Col:6;Row:17;Atr:23;Len:57;Txt:'X         2D      Minussgn 4A'),
  709.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'      Extended Scan Codes (first code=Null pg. 571)'),
  710.   (Typ:'T';Col:6;Row:2;Atr:31;Len:57;Txt:'2ndCode(dec.)   Meaning'),
  711.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'3             NUL(null character'),
  712.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'15            Shift Tab'),
  713.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'16-25         Alt-Q/W/E/R/T/Y/U/I/O/P'),
  714.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'30-38         Alt-A/S/D/F/G/H/I/J/K/L'),
  715.   (Typ:'T';Col:6;Row:7;Atr:23;Len:57;Txt:'44-50         Alt-Z/X/C/V/B/N/M'),
  716.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:'71            Home'),
  717.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'72            Up Arrow'),
  718.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:'73            PgUp'),
  719.   (Typ:'T';Col:6;Row:11;Atr:23;Len:57;Txt:'75            Left Arrow'),
  720.   (Typ:'T';Col:6;Row:12;Atr:23;Len:57;Txt:'77            Right Arrow'),
  721.   (Typ:'T';Col:6;Row:13;Atr:23;Len:57;Txt:'79            End'),
  722.   (Typ:'T';Col:6;Row:14;Atr:23;Len:57;Txt:'80            Down Arrow'),
  723.   (Typ:'T';Col:6;Row:15;Atr:23;Len:57;Txt:'81            PgDn'),
  724.   (Typ:'T';Col:6;Row:16;Atr:23;Len:57;Txt:'82            Ins'),
  725.   (Typ:'T';Col:6;Row:17;Atr:23;Len:57;Txt:'83            Del'),
  726.   (Typ:'T';Col:6;Row:1;Atr:31;Len:57;Txt:'            Extended Scan Codes (con''t)'),
  727.   (Typ:'T';Col:6;Row:2;Atr:31;Len:57;Txt:'2ndCode(dec.)   Meaning'),
  728.   (Typ:'T';Col:6;Row:3;Atr:23;Len:57;Txt:'84-93         F11-F20 (Shift-F1 to Shift-F10)'),
  729.   (Typ:'T';Col:6;Row:4;Atr:23;Len:57;Txt:'94-103        F21-F30 (Ctrl-F1 through F10)'),
  730.   (Typ:'T';Col:6;Row:5;Atr:23;Len:57;Txt:'104-113       F31-F40 (Alt-F1 through F10)'),
  731.   (Typ:'T';Col:6;Row:6;Atr:23;Len:57;Txt:'114           Ctrl-PrtSc'),
  732.   (Typ:'T';Col:6;Row:7;Atr:23;Len:57;Txt:'115           Ctrl-left Arrow'),
  733.   (Typ:'T';Col:6;Row:8;Atr:23;Len:57;Txt:'116           Ctrl-Right Arrow'),
  734.   (Typ:'T';Col:6;Row:9;Atr:23;Len:57;Txt:'117           Ctrl-End'),
  735.   (Typ:'T';Col:6;Row:10;Atr:23;Len:57;Txt:'118           Ctrl-PgDn'),
  736.   (Typ:'T';Col:6;Row:11;Atr:23;Len:57;Txt:'119           Ctrl-Home'),
  737.   (Typ:'T';Col:6;Row:12;Atr:23;Len:57;Txt:'120-131       Alt-1/2/3/4/5/6/7/8/9/0/-/='),
  738.   (Typ:'T';Col:6;Row:13;Atr:23;Len:57;Txt:'132           Ctrl-PgUp'),
  739.   (Typ:'T';Col:6;Row:14;Atr:23;Len:57;Txt:'133           Shift-F11   +-> 137     Ctrl-F11'),
  740.   (Typ:'T';Col:6;Row:15;Atr:23;Len:57;Txt:'134           F12         |   138     Ctrl-F12'),
  741.   (Typ:'T';Col:6;Row:16;Atr:23;Len:57;Txt:'135           Shift-F11   |   139     Alt-F11'),
  742.   (Typ:'T';Col:6;Row:17;Atr:23;Len:57;Txt:'136           Shift-F12 --+   140     Alt-F12')
  743. );
  744.  
  745. Begin
  746.   WriteScreen(Numfields,Fieldsarray);
  747. end;
  748.  
  749.  
  750. { MAIN INTERUPT SERVICE PROCEDURES }
  751.  
  752. procedure Syntax;
  753. begin
  754.   repeat
  755.     PrintMenu(1);
  756.     case selection of
  757.       1 : PrintType;
  758.       2 : PrintConst;
  759.       3 : PrintVar;
  760.       4 : Operator1;
  761.       5 : ProgramStructure;
  762.       6 : ProcFunc_Structure;
  763.       7 : Unit_structure;
  764.       8 : Statements;
  765.     end;
  766.     until selection = escape;
  767.     selection := 10;
  768. end;
  769.  
  770. procedure DOIT;
  771. begin
  772.   textcolor(7);
  773.   repeat
  774.     PrintMenu(0);
  775.     case selection of
  776.       1 : Syntax;
  777.       2 : PrintDirectives;
  778.       3 : RuntimeErrors;
  779.       4 : IOErrors;
  780.       5 : Reserved_words;
  781.       6 : Key_Scan_Codes;
  782.     end;
  783.   until selection = escape;
  784. end;
  785.  
  786. procedure ProcessInt(Flags,cs,ip,ax,bx,cx,dx,si,di,ds,es,bp:word);{ Start of interupt service }
  787. Interrupt;
  788.  
  789. begin
  790.  
  791. Reg.ax:=ax;
  792.  
  793. If Reg.ah <> 0 then
  794.   Begin
  795.      Intr(UserInt,reg);
  796.      ax:=reg.ax;
  797.      Flags:=reg.flags
  798.   end
  799.   else
  800.   begin
  801.     Intr(UserInt,reg);
  802.     ax:=reg.ax;
  803.     Flags:=reg.flags;
  804.     if (reg.ah = EntryChar) and (reg.al = $00) then
  805.     begin
  806.       reg.ax := $0300;
  807.       reg.bx := $0;
  808.       DefineScreen(1,10,3,72,22,1,2,$70);
  809.       OpenWindow(1);
  810.       DOIT;
  811.       CloseWindow;                     { put back the text in the window }
  812.       TerminateScreens;
  813.     end;
  814.   end;
  815. end;
  816.  
  817.  
  818. { PROGRAM 'THELP' }                    { Program installation }
  819.  
  820. Var Signature:^longint;
  821.  
  822. begin
  823.   userint:=$60;                         {start checking at first user int}
  824.   Repeat
  825.      GetIntVec(userint,Vector1);
  826.      GetIntVec(Kybdint,Vector2);
  827.   Signature:=Vector2;
  828.   If Signature^ = $52515350 then            {use push instructions at beginning of}
  829.      Begin                                  {ProcessInt as signature to detect if it}
  830.         Brite('THELP already Installed!');  {has already been loaded.}
  831.         exitcode:=3;                        {signal exit}
  832.         writeln;
  833.      End
  834.   Else
  835.   If (Meml[Seg(Vector1):Ofs(Vector1)] = $00000000) or
  836.      (Meml[Seg(Vector1):Ofs(Vector1)]=$F000F815) then {accomodate PCjr}
  837.   begin
  838.     writeln('Installing THELP  --  Press < ALT ''H'' > to Recall help.');
  839.     writeln('');
  840.     GetIntVec(Kybdint,Vector2);
  841.     SetIntVec(UserInt,Vector2);
  842.     SetIntVec(KybdInt,@ProcessInt);
  843.     keep(exitcode);
  844.   end;
  845.   userint:=userint+1;
  846.   Until (exitcode = 3) or (UserInt > $67);
  847.   If exitcode <> 3 then  writeln('User Interupts in use -- can''t install THELP.')
  848. end.
  849.